import request from '@/utils/request'

const api = {
  list: '/sys-operation-log/list',
  query: '/sys-operation-log/query',
  detail: '/sys-operation-log/detail',
  clean: '/sys-operation-log/clean',
  analysis: '/sys-operation-log/analysis'
}

export default {
  // 获取操作日志列表
  list(params) {
    return request({
      url: api.list,
      method: 'get',
      params
    })
  },
  
  // 查询操作日志
  query(params) {
    return request({
      url: api.query,
      method: 'get',
      params
    })
  },
  
  // 获取操作日志详情
  detail(id) {
    return request({
      url: `${api.detail}/${id}`,
      method: 'get'
    })
  },
  
  // 清空操作日志
  clean() {
    return request({
      url: api.clean,
      method: 'delete'
    })
  },
  
  // 获取操作日志分析数据
  analysis(params) {
    return request({
      url: api.analysis,
      method: 'get',
      params
    })
  }
}